package com.neuronbit.businessflow.runtime.exec;

import lombok.Data;

import java.time.LocalDateTime;

@Data
public class ExecutedFlowInstance {
    private String executionId;
    private String flowId;
    private String flowName;
    private String flowTypeName;
    private String returnTypeName;
    private String returns;
    private String contextTypeName;
    private String context;
    private FlowExecutionStatus status;
    private String lockStatus;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private String errorMessage;

    public void setLockStatus(LockStatus lockStatus) {
        if (lockStatus == LockStatus.UNLOCKED) {
            this.lockStatus = lockStatus.name() + "_" + executionId;
        } else {
            this.lockStatus = lockStatus.name();
        }
    }
}
